import { _decorator, Component, Node } from 'cc';
import { BaseComponent } from '../Manager/UIManager/BaseComponent';
import { GAME_POP, GAME_SCENE, GlobalData } from '../Data/GlobalData';
const { ccclass, property } = _decorator;

@ccclass('PopEndBox')
export class PopEndBox extends BaseComponent {


    protected OnShow(): void {
        GlobalData.GameOver = true;
    }

    /**
     * 点击返回主菜单
     */
    onClickBack() {
        app.popManager.HidePop(GAME_POP.POPENDBOX)
        app.uiManager.ShowUI(GAME_SCENE.LoginScene)
    }

    /**
     * 点击重新开始
     */
    onClickRestart() {
        app.popManager.HidePop(GAME_POP.POPENDBOX)
        app.uiManager.ShowUI(GAME_SCENE.GameScene)
    }

}


